<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'register.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->


<title>注册</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="js/easyform.js"></script>
</head>
<body>
	<input type="button" value="注册失败，点击重新注册" onclick="showWin()" />
	<br />

	<div id="popup" class="hide">
		<a href="javascript:closeWin()" id="close">关闭</a><br>
		<div class="form-div">
			<form id="reg-form" action="register.action" method="post">
				<table>
					<tr>
						<td>用户名</td>
						<td><input name="userInfoBean.userId" type="text" id="uid"
							easyform="length:4-16;char-normal;real-time;"
							message="用户名必须为4—16位的英文字母或数字"
							easytip="disappear:lost-focus;theme:blue;" ajax-message="用户名已存在!">
						</td>
					</tr>
					<tr>
						<td>密码</td>
						<td><input name="userInfoBean.pwd" type="password" id="psw1"
							easyform="length:6-16;" message="密码必须为6—16位"
							easytip="disappear:lost-focus;theme:blue;"></td>
					</tr>
					<tr>
						<td>确认密码</td>
						<td><input name="psw2" type="password" id="psw2"
							easyform="length:6-16;equal:#psw1;" message="两次密码输入要一致"
							easytip="disappear:lost-focus;theme:blue;"></td>
					</tr>
					<tr>
						<td>email</td>
						<td><input name="userInfoBean.email" type="text" id="email"
							easyform="email;real-time;" message="Email格式要正确"
							easytip="disappear:lost-focus;theme:blue;"
							ajax-message="这个Email地址已经被注册过，请换一个吧!"></td>
					</tr>
				</table>

				<div class="buttons">
					<input value="注 册" type="submit"
						style="margin-right:20px; margin-top:20px;"> <input
						value="我有账号，我要登录" type="button"
						style="margin-right:45px; margin-top:20px;">
				</div>

				<br class="clear">
			</form>
		</div>
	</div>
	<script>
		function showWin() {
			var popup = document.getElementById("popup");
			popup.className = "show";
			popup.style.position = "absolute";
			popup.style.top = "50%";
			popup.style.left = "50%";
			popup.style.marginTop = "-225px";
			popup.style.marginLeft = "-215px";
			popup.style.width = "430px";
			popup.style.height = "450px";
			popup.style.zIndex = "101";

			var mybg = document.createElement("div");
			mybg.setAttribute("id", "mybg");
			mybg.style.background = "#abcdef";
			mybg.style.width = "100%";
			mybg.style.height = "100%";
			mybg.style.position = "absolute";
			mybg.style.top = "0";
			mybg.style.left = "0";
			mybg.style.zIndex = "100";
			mybg.style.opacity = "0.3";
			mybg.style.filter = "Alpha(opacity=30)";
			document.body.appendChild(mybg);
			document.body.style.overflow = "hidden";
		}
		function closeWin() {
			var popup = document.getElementById("popup");
			popup.className = "hide";
			var mybg = document.getElementById("mybg");
			mybg.parentNode.removeChild(mybg);
		}

		// $(document).ready(function(){
		// 	$('#reg-form').easyform();
		// });
	</script>
</body>
</html>
